﻿<%@ Page Title="Departure Seat Map" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="DepFltSeatMap.aspx.cs" Inherits="IFD2.DepFltSeatMap" %>

<%@ Register Src="~/ctl_seat_map.ascx" TagPrefix="uc1" TagName="ctl_seat_map" %>
<%@ Register Src="~/ctlSeatMatching.ascx" TagPrefix="uc1" TagName="ctlSeatMatching" %>


<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <%--<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>--%>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="Flight:" meta:resourcekey="Flight"></asp:Label>
                <asp:Label ID="lblOpAirline" runat="server"></asp:Label>
                <asp:TextBox ID="txtFltNo" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength="10"></asp:TextBox>
                <asp:Label ID="Label8" runat="server" Text="Date:" meta:resourcekey="Date"></asp:Label>
                <asp:TextBox ID="txtFltDate" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength="15"></asp:TextBox>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <asp:Button ID="btnLog" runat="server" Text="Logs..." OnClick="btnLog_Click"  meta:resourcekey="Logs" CssClass="form-control input-sm btn-primary text-center" Width="100%" />
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>

            <asp:HiddenField ID="hidFltNo" runat="server" />
            <asp:HiddenField ID="hidFltDate" runat="server" />
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <uc1:ctl_seat_map runat="server" id="ctl_seat_map" />
                    </div>
                    <asp:Button ID="btnDelete" runat="server" OnClick="btnDelete_Click" Text="Delete"  meta:resourcekey="Delete" CssClass="btn btn-sm btn-default" /><br />
                    <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>
                    <br />
                    <div class="table-responsive">
                        <uc1:ctlSeatMatching runat="server" id="ctlSeatMatching" />
                    </div>

                    <div class="well well-sm">
                        <div class="form-group">
                        <asp:Label ID="Label21" runat="server" meta:resourcekey="ChangeField" Text="Change:"></asp:Label>
                        <asp:DropDownList ID="lstEditTarget" runat="server">
                            <asp:ListItem meta:resourcekey="Seat_type" Value="S">Seat Type</asp:ListItem>
                            <asp:ListItem meta:resourcekey="class" Value="C">Class</asp:ListItem>
                            <asp:ListItem meta:resourcekey="OriAirport" Value="O">Ori. Airport</asp:ListItem>
                            <asp:ListItem meta:resourcekey="DesAirport" Value="D">Des. Airport</asp:ListItem>
                            <asp:ListItem meta:resourcekey="Attributes1" Value="A">Attributes</asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        =
                        <asp:TextBox ID="txtNewValue" runat="server" MaxLength="10" Width="124px"></asp:TextBox>
                        <asp:Label ID="Label17" runat="server" meta:resourcekey="NoControl" Text="[* = No Control]"></asp:Label>
                        </div>
                        <br class="hidden-xs" />
                        <asp:Label ID="Label22" runat="server" Text="Where:" meta:resourcekey="Where"></asp:Label>
                        <br />
                        <asp:TextBox ID="txtWhere" runat="server" Height="69px" MaxLength="100" Width="100%"
                            TextMode="MultiLine">col in (&#39;A&#39;,&#39;K&#39;) and row between 9 and 20 and cabin=&#39;Y&#39; 
and attributes like &#39;%E%&#39;</asp:TextBox>
                        <br />
                        <asp:Label ID="Label18" runat="server" meta:resourcekey="AvailFields" Text="Avail key words: row,col,seat_type,attributes,class,cabin,load_area" Font-Italic="true"></asp:Label>
                        <br />
                        <asp:Button ID="btnChange" runat="server" meta:resourcekey="Change" onclick="btnChange_Click" Text="Change" CssClass="btn btn-sm btn-default" />
                        <br />
                        <asp:Label ID="lblErrChange" runat="server" CssClass="ifdMessage"></asp:Label>
                    </div>

                    <div class="well well-sm">
                        <asp:Label ID="Label15" runat="server" Font-Bold="True" Text="New Seat Cell" meta:resourcekey="NewCell"></asp:Label>
                        <br />
                        <div class="form-group">
                        <asp:Label ID="Label2" runat="server" Text="X=" meta:resourcekey="X"></asp:Label>
                        <asp:TextBox ID="txtX" runat="server" Width="42px" MaxLength="3"></asp:TextBox>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label3" runat="server" Text="Y=" meta:resourcekey="Y"></asp:Label>
                        <asp:TextBox ID="txtY" runat="server" Width="41px" MaxLength="2"></asp:TextBox>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label6" runat="server" Text="Type:" meta:resourcekey="Type"></asp:Label>
                        <asp:DropDownList ID="lstSpaceTypes" runat="server">
                            <asp:ListItem Value="S" meta:resourcekey="Seat" Text="Seat"></asp:ListItem>
                            <asp:ListItem Value="R" meta:resourcekey="Road" Text="Road"></asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label4" runat="server" Text="Seat Row:" meta:resourcekey="SeatRow"></asp:Label>
                        <asp:TextBox ID="txtRow" runat="server" Width="30px"></asp:TextBox>
                        <asp:Label ID="Label5" runat="server" Text="Col:" meta:resourcekey="Col"></asp:Label>
                        <asp:DropDownList ID="lstCols" runat="server">
                            <asp:ListItem>A</asp:ListItem>
                            <asp:ListItem>B</asp:ListItem>
                            <asp:ListItem>C</asp:ListItem>
                            <asp:ListItem>D</asp:ListItem>
                            <asp:ListItem>E</asp:ListItem>
                            <asp:ListItem>F</asp:ListItem>
                            <asp:ListItem>G</asp:ListItem>
                            <asp:ListItem>H</asp:ListItem>
                            <asp:ListItem>I</asp:ListItem>
                            <asp:ListItem>J</asp:ListItem>
                            <asp:ListItem>K</asp:ListItem>
                            <asp:ListItem>L</asp:ListItem>
                            <asp:ListItem>M</asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <br class="hidden-xs" />
                        <div class="form-group">
                        <asp:Label ID="Label13" runat="server" Text="Load Area:" meta:resourcekey="LoadArea"></asp:Label><asp:DropDownList
                            ID="lstLoadArea" runat="server">
                            <asp:ListItem Value="A">OA</asp:ListItem>
                            <asp:ListItem Value="B">OB</asp:ListItem>
                            <asp:ListItem Value="C">OC</asp:ListItem>
                            <asp:ListItem Value="D">OD</asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label7" runat="server" Text="Cabin:" meta:resourcekey="Cabin"></asp:Label>
                        <asp:DropDownList ID="lstAcCabins" runat="server" DataSourceID="sqlAcCabins" DataTextField="cabin"
                            DataValueField="cabin" AutoPostBack="true" onselectedindexchanged="lstAcCabins_SelectedIndexChanged">
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label9" runat="server" Text="Ori. Airport:" meta:resourcekey="OriAirport"></asp:Label>
                        <asp:DropDownList ID="lstOriAirports" runat="server" DataSourceID="sqlOriAirports" 
                            DataTextField="ori_airport" DataValueField="ori_airport" AutoPostBack="True" 
                            onselectedindexchanged="lstAirports_SelectedIndexChanged" ondatabound="lstOriAirports_DataBound">
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label23" runat="server" meta:resourcekey="DesAirport" Text="Des. Airport:"></asp:Label>
                        <asp:DropDownList ID="lstDesAirports" runat="server" AutoPostBack="True" 
                            DataSourceID="sqlDesAirports" DataTextField="des_airport" DataValueField="des_airport" 
                            onselectedindexchanged="lstAirports_SelectedIndexChanged" ondatabound="lstDesAirports_DataBound">
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label16" runat="server" Text="Class:"></asp:Label>
                        <asp:DropDownList ID="lstClasses" runat="server" DataSourceID="sqlFltClasses" 
                            DataTextField="class" DataValueField="class" ondatabound="lstClasses_DataBound">
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label11" runat="server" meta:resourcekey="ReserveFor" Text="Seat Type:"></asp:Label>
                        <asp:TextBox ID="txtSeatType" runat="server" MaxLength="2" Text="*" Width="20px"></asp:TextBox> 
                        </div>
                        <br class="hidden-xs"/>
                        <div class="form-group">
                        <asp:Label ID="Label19" runat="server" meta:resourcekey="Attributes" Text="Attributes:"></asp:Label>
                        <asp:TextBox ID="txtAttributes" runat="server" MaxLength="10" Width="198px"></asp:TextBox>
                        </div>
                        <br class="hidden-xs"/>
                        <asp:Label ID="Label20" runat="server" meta:resourcekey="legAttributes" Text="(I)nfant,(L)ongLeg,(E)mergencyExit" Font-Italic="true"></asp:Label>
                        <br />
                        <asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text=" Add " meta:resourcekey="Add" CssClass="btn btn-sm btn-default" />
                        <br />
                        <asp:Label ID="lblErrAdd" runat="server" CssClass="ifdMessage"></asp:Label>

                        <asp:SqlDataSource ID="sqlAcCabins" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                            SelectCommand="bll_flt_get_cabin_codes" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                            <SelectParameters>
                                <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                                <asp:ControlParameter ControlID="hidFltNo" Name="flt_no" PropertyName="Value" Type="String" />
                                <asp:ControlParameter ControlID="hidFltDate" Name="flt_date" PropertyName="Value" Type="DateTime" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <asp:SqlDataSource ID="sqlOriAirports" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                            SelectCommand="bll_flt_get_ori_airports" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lblOpAirline" Name="airline" PropertyName="Text" Type="String" />
                                <asp:ControlParameter ControlID="hidFltNo" Name="flt_no" PropertyName="Value" Type="String" />
                                <asp:ControlParameter ControlID="hidFltDate" Name="flt_date" PropertyName="Value" Type="DateTime" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                
                        <asp:SqlDataSource ID="sqlDesAirports" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                            SelectCommand="bll_flt_get_des_airports" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                            <SelectParameters>
                                <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                                <asp:ControlParameter ControlID="hidFltNo" Name="flt_no" PropertyName="Value" Type="String" />
                                <asp:ControlParameter ControlID="hidFltDate" Name="flt_date" PropertyName="Value" Type="DateTime" />
                            </SelectParameters>
                        </asp:SqlDataSource>

                        <asp:SqlDataSource ID="sqlFltClasses" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                            SelectCommand="bll_flt_get_segment_classes" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                            <SelectParameters>
                                <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                                <asp:ControlParameter ControlID="txtFltNo" Name="flt_no" PropertyName="Text" Type="String" />
                                <asp:ControlParameter ControlID="txtFltDate" Name="flt_date" PropertyName="Text" Type="DateTime" />
                                <asp:ControlParameter ControlID="lstAcCabins" Name="cabin" PropertyName="SelectedValue" Type="String" />
                                <asp:ControlParameter ControlID="lstOriAirports" Name="ori_airport" PropertyName="SelectedValue" Type="String" />
                                <asp:ControlParameter ControlID="lstDesAirports" Name="des_airport" PropertyName="SelectedValue" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </div>
                </div>
            </div>
        </div>
    </div>

    </div>
    <%--</ContentTemplate></asp:UpdatePanel>--%>
    </form>
</asp:Content>
